﻿
package com.wit.service.impl;

import java.util.Date;
import java.util.List;

import com.wit.po.Policy;
import com.wit.po.Wage;
import com.wit.service.WageService;
import com.wit.dao.WageDao;

public class WageServiceImpl implements WageService {

	private WageDao wageDao;
	
	public boolean addWage(Wage wage)
	{
		return wageDao.addWage(wage);
	}
	public boolean removeWage(Wage wage)
	{
		return wageDao.removeWage(wage);
	}
	public boolean updateWage(Wage wage)
	{
		return wageDao.updateWage(wage);
	}
	
	public Wage getWageById(int wageId)
	{
		return wageDao.getWageById(wageId);
	}
	
	public List<Wage> getWageList(Wage wage, Integer pageNumber, Integer pageSize)
	{
		return wageDao.getWageList(wage,pageNumber,pageSize);
	}
	
	public int getTotalAmount(Wage wage)
	{
		return wageDao.getTotalAmount(wage);
	}
	

	public int generateWage(Date inMonth)
	{
		return wageDao.generateWage(inMonth);
	}
	
	public int updateBatchOfWage(Integer []wageIdArray)
	{
		List<Wage> wageList = wageDao.getWageListByIds(wageIdArray);
		return wageDao.updateBatchOfWage(wageList);
	}
	
	public int updateBatchOfWage(List<Wage> wageList)
	{
		return wageDao.updateBatchOfWage(wageList);
	}
	
	public Object[] getPolicyFee(String employeeId, int year, int month)
	{
		return wageDao.getPolicyFee(employeeId, year, month);
	}
	public Object[] getPolicyFee(String employeeId, int year, int startMonth, int endMonth)
	{
		return wageDao.getPolicyFee(employeeId, startMonth, endMonth);
	}
	public Object[] getPolicyFee(String employeeId, int year)
	{
		return wageDao.getPolicyFee(employeeId, year);
	}

	public List<Policy> getPolicyList(String employeeId, Integer year, Integer pageNumber, Integer pageSize)
	{
		return wageDao.getPolicyList(employeeId, year, pageNumber, pageSize);
	}
	public List<Policy> getPolicyList(String employeeId, Integer year, Integer startMonth, Integer endMonth, 
			Integer pageNumber, Integer pageSize)
	{
		return wageDao.getPolicyList(employeeId, year, startMonth, endMonth, pageNumber, pageSize);
	}
	public List<Policy> getPolicyList(String employeeId, Integer year, Integer month, Integer pageNumber, Integer pageSize)
	{
		return wageDao.getPolicyList(employeeId, year, month, pageNumber, pageSize);
	}
	
	/******************* Getters and Setters **********************/
	
	public WageDao getWageDao() {
		return wageDao;
	}
	public void setWageDao(WageDao wageDao) {
		this.wageDao = wageDao;
	}
}